<template>
    <div class="hero-detail-container">
        <div class="markdown-body">
            <el-row type="flex" justify="start" align="middle">
                <h3>{{detailData.name}}</h3>
            </el-row>
            <div style="margin-bottom: 12px">
                <strong>血量</strong><i>{{detailData.hp}}</i>
                <strong> · </strong>
                <strong>武器</strong><i>{{ detailData.weapons ? detailData.weapons.join("、") : "" }}</i>
            </div>
            <h3>特殊能力</h3>
            <ul>
                <li v-for="(item,index) in detailData.ability" :key="index">{{item}}</li>
            </ul>
            <h3>介绍</h3>
            <MarkedContent :mdString="detailData.content"></MarkedContent>
        </div>
    </div>
</template>

<script>
    import 'github-markdown-css'
    import MarkedContent from '@/components/MarkedContent'

    export default {
        name: "ForgeHeroDetail",
        data(){
            return{
                detailData : {}
            }
        },
        components : {
            MarkedContent
        },
        activated(){
            let id = this.$route.query.id;
            this.getDetailData(id);
        },

        methods: {
            getDetailData(id) {
                this.axios.get('/activity/single',{
                    params : {
                        id
                    }
                })
                    .then(res=>{
                        this.detailData = res.data;
                    })
            }
        },
    }
</script>

<style lang="scss" scoped>
    .hero-detail-container{
        padding: 16px;
        i{
            margin-left: 8px;
            padding-top: 16px;
            color: #999;
            font-size: 12px;
        }
    }
</style>